import math
import filter

def dis2line(pt1,pt2,pt3):
    line = filter.dis(pt1,pt2)
    area=triArea(pt1,pt2,pt3)
    return 2*area/line
def triArea(pt1,pt2,pt3):
    a = filter.dis(pt1,pt2)
    b = filter.dis(pt2,pt3)
    c = filter.dis(pt1,pt3)


    s = (a + b + c) / 2

    # calculate the area
    area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
    print('The area of the triangle is %0.2f' %area)

    return area

rt1=(0,0,200,300)
rt2=(10,0,150,250)
rt3=(0,20,100,200)
pt1=filter.get_center(rt1)
pt2=filter.get_center(rt2)
pt3=filter.get_center(rt3)
print(pt1)
print(pt2)
print(pt3)
print("aaaaaaaa")
print(triArea(pt1,pt2,pt3))


